Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic ds creating emtpy values #268

Merged
merged 5 commits into from
Jun 30, 2024
Merged

Conversation

stwiname
Copy link
Contributor

@stwiname stwiname commented Jun 30, 2024

Description

Fixes dynamic ds creation so that it deals with undefined filter properties

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

Copy link
Contributor

github-actions bot commented Jun 30, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 41.18% 2233/5423
🟡 Branches 76.99% 251/326
🔴 Functions 47.77% 118/247
🔴 Lines 41.18% 2233/5423

Test suite run failed

Failed tests: 16/67. Failed suites: 2/8.
  ● CosmosUtils › filter message data for true

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filter message data for false

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filter nested message data for true

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filter nested message data for false

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filter nested message data for invalid path

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › does not wrap events of failed transaction

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › does not lazy decode failed message filters

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › lazy decode passed message filters

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › can filter long type decoded msg for true

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › can filter long type decoded msg for number filter

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › can filter long type decoded msg for false

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filterMessageData function › contractCall filtering › should return true for non-object contractCall in msg

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filterMessageData function › contractCall filtering › should return false for non-object contractCall not in msg

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filterMessageData function › contractCall filtering › should return false for object contractCall not in msg

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● CosmosUtils › filterMessageData function › contractCall filtering › should return true for object contractCall in msg

    Request failed with status code 502

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)


  ● KyveApi › able to fetch/write/read blocks using Kyve api

    TypeError: Cannot read properties of undefined (reading 'id')

      452 |     return bundles.filter((b) => {
      453 |       const isNotCurrentBundleAndLower =
    > 454 |         currentBundle.id !== b.id &&
          |                       ^
      455 |         parseDecimal(currentBundle.id) > parseDecimal(b.id);
      456 |       const isOutsiderBuffer = height > parseDecimal(b.to_key) + bufferSize;
      457 |

      at packages/node/src/utils/kyve/kyve.ts:454:23
          at Array.filter (<anonymous>)
      at KyveApi.getToRemoveBundles (packages/node/src/utils/kyve/kyve.ts:452:20)
      at KyveApi.clearFileCache (packages/node/src/utils/kyve/kyve.ts:467:29)
      at KyveApi.fetchBlocksBatches (packages/node/src/utils/kyve/kyve.ts:572:5)
          at async Promise.all (index 0)
      at Object.<anonymous> (packages/node/src/utils/kyve/kyve.spec.ts:313:22)

Report generated by 🧪jest coverage report action from 6df6bca

'Cannot set values on handler without predefined messageFilter type',
);
}
handler.filter.values ??= {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be in this way?

handler.filter.values = {
  ...(handler.filter.values || {}),
  ...(params.args.values as Record<string, string>),
};

@stwiname stwiname merged commit 8c39ba8 into main Jun 30, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants